define(function(require, exports, module) {
	"require:nomunge,exports:nomunge,module:nomunge";

	var app = require('mokit/app');
	var json = require('mokit/json');
	var HomeView = require('../views/home');
	var User = require('../models/User');
	var Index = require("../models/Index");
	var utils = require('mokit/utils');
	var commonUtils = require('../common/utils');
	var $event = require('mokit/event');
	var Task = require('mokit/task');


	/**
	 * 主页控制器
	 */
	return app.controller.create({

		/**
		 * 默认action
		 */
		index: function(context) {
			var self = this;
			//清空返回处理队列
			commonUtils.backAction = [];
			//任务队列
			/*
			var task = Task.create();
			task.add(function(done) {
				Index.getList(done);
			});			
			task.add(function(done) {
				Project.getCatList(done);
			});
			task.add(function(done) {
				Provider.getList(done);
			});
			task.add(function(done) {
				Article.getList(done);
			});
			task.add(function(done) {
				Faq.getList(done);
			});
			task.end(function() {			
				self.setView(new HomeView({
					model: {
						user: User,
						project: Project,
						provider: Provider,
						article: Article,
						faq: Faq
					}
				}));
			});
			*/
			Index.getList(function() {			
				self.setView(new HomeView({
					model: {
						user: User,
						data: Index.data
					}
				}));
			});
		},

		/**
		 * 在释放时
		 */
		onDispose: function(context) {
			var self = this;

		}

	});
});